﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MuaChung.Models.TAI_KHOAN>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Danh sách tài khoản
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Danh sách tài khoản</h2>

    <div id="PagingContent1" class="PagingContent">
        <%string i = ViewData["cp"].ToString();
          string s = ViewData["ps"].ToString(); %>
        <script type="text/javascript">
            GetContent("/Share/Paging?type=allAccount&currentPage=<%:i %>&pageSize=<%: s %>", "PagingContent1");
        </script>
    </div>
    <div style="clear:both">
    <table>
        <tr>                        
            <th>
                Tên đăng nhập
            </th>            
            <th>
                Email
            </th>
            <th>
                Đang online
            </th>
            <th>
                Tình trạng
            </th>
            <th>
                Quyền
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
                        
            <td>
                <%: item.Username %>
            </td>            
            <td>
                <%: item.Email %>
            </td>
            <td>
                <% if (item.SignedIn == 1)
                   {%>
                       x
                 <%}  %>
            </td>
            <td>
                <%:item.Status %>
            </td>
            <td>
                <%: item.Role %>
            </td>
            <td>
                <%: Html.ActionLink("Chỉnh sửa", "EditAccount", new { id=item.ID }) %> |                
                <%: Html.ActionLink("Xóa", "DeleteAccount", new { id=item.ID })%>
            </td>
        </tr>
    
    <% } %>

    </table>
    </div>
    <div id="PagingContent2" class="PagingContent">        
        <script type="text/javascript">
            GetContent("/Share/Paging?type=allAccount&currentPage=<%:i %>&pageSize=<%: s %>", "PagingContent2");
        </script>
    </div>
    <p>
        <%: Html.ActionLink("Tạo mới", "AddAccount") %>
    </p>
    
    

</asp:Content>

